package net.dgg.rz.production.entity;

import com.alibaba.fastjson.JSONObject;
import net.dgg.rz.common.base.entity.BaseEntity;
import org.springframework.data.annotation.Transient;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 核款产品 实体
 */
public class PayProductRecord extends BaseEntity {

    /**
     * 编号
     */
    private String payNo;

    /**
     * 大业态code
     */
    private String busitypeCode;

    /**
     * 业态名称
     */
    private String busitypeName;

    /**
     * 小业态
     */
    private String smallBusiness;

    /**
     * 小业态名称
     */
    private String smallBusinessName;
    /**
     * 业绩计算人员ID
     */
    private Long payUserId;
    /**
     * 业绩计算人员name
     */
    private String payUserName;

    /**
     * 团队ID
     */
    private Long teamId;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品ID
     */
    private Long productId;
    /**
     * 商品名称
     */
    private String commodityName;

    /**
     * 商品ID
     */
    private Long commodityId;
    /**
     * 渠道名称
     */
    private String channelName;

    /**
     * 渠道ID
     */
    private Long channelId;

    /**
     * 生产单ID
     */
    private Long productOrderId;
    /**
     * 生产单编号
     */
    private String productOrderNo;

    /**
     * 所属事业部ID
     */
    private Long productOrderOrgId;
    /**
     * 所属事业部name
     */
    private String productOrderOrgName;

    /**
     * 部门ID
     */
    private Long productOrderUserOrgId;
    /**
     * 部门name
     */
    private String productOrderUserOrgName;
    /**
     * 销售主订单ID
     */
    private Long orderId;

    /**
     * 销售子订单ID
     */
    private Long orderBusinessId;
	
	
    /**
     * 销售子订单编号
     */
    private String orderBusinessNo;

    /**
     * 认款商品ID（财务系统源数据id）
     */
    private Long payProductRecordId;
    /**
     * 财务ID
     */
    private Long paymentId;

    /**
     * 收据编号
     */
    private String receiptNo;

    /**
     * 内部成本
     */
    private BigDecimal internalCost;

    /**
     * 外部成本
     */
    private BigDecimal externalCost;

    /**
     * 业绩
     */
    private BigDecimal performance;

    /**
     * 利润
     */
    private BigDecimal profit;

    /**
     * 认款金额
     */
    private BigDecimal amount;

    /**
     * 退款金额
     */
    private BigDecimal reimburseAmount;

    /**
     * 是否推送 0 否 1 是
     */
    private Integer isPush = 0;

    /**
     * 类型  1 核款 2 退款 3 内部下单返点利润
     */
    private Integer type;

    /**
     * 是否自开发 0 否 1 是
     */
    private Integer isSelf;

    /**
     * 原始接收数据json
     */
    private String dataJson;
    /**
     * 推送薪酬系统数据json
     */
    private String pushJson;

    /**
     * 业绩计算时间
     * @return
     */
    private Date amountMonth;

    /**
     *是否有效(逻辑删除) 0 无效 1有效'
     * @return
     */
    private Integer isValid=1;

    /**
     * 计算项json
     */
    @Transient
    private JSONObject calculationItem;
    /**
     * 提成
     */
    @Transient
    private BigDecimal performanceData;
    /**
     * 认款时间
     */
    @Transient
    private String amountMonthStr;

    public String getAmountMonthStr() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String monthStr = this.amountMonth==null?"":sdf.format(this.amountMonth);
        return monthStr;
    }

    public JSONObject getCalculationItem() {
        return calculationItem;
    }

    public void setCalculationItem(JSONObject calculationItem) {
        this.calculationItem = calculationItem;
    }

    public BigDecimal getPerformanceData() {
        return performanceData;
    }

    public void setPerformanceData(BigDecimal performanceData) {
        this.performanceData = performanceData;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Date getAmountMonth() {
        return amountMonth;
    }

    public void setAmountMonth(Date amountMonth) {
        this.amountMonth = amountMonth;
    }

    public String getBusitypeCode() {
        return busitypeCode;
    }

    public void setBusitypeCode(String busitypeCode) {
        this.busitypeCode = busitypeCode;
    }

    public String getBusitypeName() {
        return busitypeName;
    }

    public void setBusitypeName(String busitypeName) {
        this.busitypeName = busitypeName;
    }

    public String getSmallBusiness() {
        return smallBusiness;
    }

    public void setSmallBusiness(String smallBusiness) {
        this.smallBusiness = smallBusiness;
    }

    public String getSmallBusinessName() {
        return smallBusinessName;
    }

    public void setSmallBusinessName(String smallBusinessName) {
        this.smallBusinessName = smallBusinessName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductOrderNo() {
        return productOrderNo;
    }

    public void setProductOrderNo(String productOrderNo) {
        this.productOrderNo = productOrderNo;
    }

    public Long getOrderBusinessId() {
        return orderBusinessId;
    }

    public void setOrderBusinessId(Long orderBusinessId) {
        this.orderBusinessId = orderBusinessId;
    }

    public String getOrderBusinessNo() {
        return orderBusinessNo;
    }

    public void setOrderBusinessNo(String orderBusinessNo) {
        this.orderBusinessNo = orderBusinessNo;
    }

    public Long getPayProductRecordId() {
        return payProductRecordId;
    }

    public void setPayProductRecordId(Long payProductRecordId) {
        this.payProductRecordId = payProductRecordId;
    }

    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    public String getReceiptNo() {
        return receiptNo;
    }

    public void setReceiptNo(String receiptNo) {
        this.receiptNo = receiptNo;
    }

    public BigDecimal getInternalCost() {
        return internalCost;
    }

    public void setInternalCost(BigDecimal internalCost) {
        this.internalCost = internalCost;
    }

    public BigDecimal getExternalCost() {
        return externalCost;
    }

    public void setExternalCost(BigDecimal externalCost) {
        this.externalCost = externalCost;
    }

    public BigDecimal getPerformance() {
        return performance;
    }

    public void setPerformance(BigDecimal performance) {
        this.performance = performance;
    }

    public BigDecimal getProfit() {
        return profit;
    }

    public void setProfit(BigDecimal profit) {
        this.profit = profit;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getReimburseAmount() {
        return reimburseAmount;
    }

    public void setReimburseAmount(BigDecimal reimburseAmount) {
        this.reimburseAmount = reimburseAmount;
    }

    public Integer getIsPush() {
        return isPush;
    }

    public void setIsPush(Integer isPush) {
        this.isPush = isPush;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getPayUserId() {
        return payUserId;
    }

    public void setPayUserId(Long payUserId) {
        this.payUserId = payUserId;
    }

    public Long getTeamId() {
        return teamId;
    }

    public void setTeamId(Long teamId) {
        this.teamId = teamId;
    }

    public String getPayUserName() {
        return payUserName;
    }

    public void setPayUserName(String payUserName) {
        this.payUserName = payUserName;
    }

    public String getCommodityName() {
        return commodityName;
    }

    public void setCommodityName(String commodityName) {
        this.commodityName = commodityName;
    }

    public Long getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(Long commodityId) {
        this.commodityId = commodityId;
    }

    public Integer getIsSelf() {
        return isSelf;
    }

    public void setIsSelf(Integer isSelf) {
        this.isSelf = isSelf;
    }

    public String getDataJson() {
        return dataJson;
    }

    public void setDataJson(String dataJson) {
        this.dataJson = dataJson;
    }

    public String getPushJson() {
        return pushJson;
    }

    public void setPushJson(String pushJson) {
        this.pushJson = pushJson;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public Long getProductOrderId() {
        return productOrderId;
    }

    public void setProductOrderId(Long productOrderId) {
        this.productOrderId = productOrderId;
    }

    public Long getProductOrderOrgId() {
        return productOrderOrgId;
    }

    public void setProductOrderOrgId(Long productOrderOrgId) {
        this.productOrderOrgId = productOrderOrgId;
    }

    public String getProductOrderOrgName() {
        return productOrderOrgName;
    }

    public void setProductOrderOrgName(String productOrderOrgName) {
        this.productOrderOrgName = productOrderOrgName;
    }

    public Long getProductOrderUserOrgId() {
        return productOrderUserOrgId;
    }

    public void setProductOrderUserOrgId(Long productOrderUserOrgId) {
        this.productOrderUserOrgId = productOrderUserOrgId;
    }

    public String getProductOrderUserOrgName() {
        return productOrderUserOrgName;
    }

    public void setProductOrderUserOrgName(String productOrderUserOrgName) {
        this.productOrderUserOrgName = productOrderUserOrgName;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }
}